* lisp/replace.el (perform-replace): Accept default bindings in lookup-key.
authorJuri Linkov <juri@linkov.net>
Sat, 2 Mar 2024 17:22:30 +0000 (19:22 +0200)
committerJuri Linkov <juri@linkov.net>
Sat, 2 Mar 2024 17:22:30 +0000 (19:22 +0200)
Set ACCEPT-DEFAULT arg of lookup-key to t (bug#69342).
This will allow the users to ignore unbound keys with
‘(define-key query-replace-map [t] 'ignore)’.

lisp/replace.el

index fa460a16063b4b896d744934395fa77fa3771dd5..49e7c85c487ab19b02cd44151c90aae9a97cc00b 100644 (file)
@@ -2916,7 +2916,7 @@ characters."
 
     ;; If last typed key in previous call of multi-buffer perform-replace
     ;; was `automatic-all', don't ask more questions in next files
-    (when (eq (lookup-key map (vector last-input-event)) 'automatic-all)
+    (when (eq (lookup-key map (vector last-input-event) t) 'automatic-all)
       (setq query-flag nil multi-buffer t))
 
     (cond
@@ -3100,7 +3100,7 @@ characters."
                  ;; read-event that clobbers the match data.
                  (set-match-data real-match-data)
                  (setq key (vector key))
-                 (setq def (lookup-key map key))
+                 (setq def (lookup-key map key t))
                  ;; Restore the match data while we process the command.
                  (cond ((eq def 'help)
                         (let ((display-buffer-overriding-action